import React from 'react'
import {Consumer} from '../context'
export default class Sun extends React.Component{
     render(){
         return (
             <Consumer>
                 {
                     state=>{
                         console.log(state,'孙子')
                         return (
                             <div>

                                 <h2>孙子</h2>
                                 <button onClick={state.changeMsg('孙子改变的')}>改变msg</button>
                             </div>
                         )
                     }
                 }
             </Consumer>
         )
     }
}